package com.dhp.bkOjfeignclient.service;


import com.dhp.model.entity.Question;
import com.dhp.model.entity.QuestionSubmit;
import com.dhp.model.vo.QuestionVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;


/**
 * 题目服务feignclient
 */
@FeignClient(name = "bkOj-question-service" , path = "/api/question/inner")
public interface QuestionFeignClient {
    /**
     * 根据id获取题目信息
     * @param questionId 题目id
     * @return 题目信息
     */
    @GetMapping("/getById")
    public Question getById(@RequestParam("questionId") Long questionId);

    /**
     * 根据id更新题目信息
     * @param question 需更新题目信息
     * @return 是否更新成功 是 true  否 false
     */
    @PostMapping("/question/updateById")
    public boolean updateQuestionById(@RequestBody Question question);

    /**
     * 根据id获取题目提交信息
     * @param submitId 提交记录id
     * @return 提交记录信息
     */
    @GetMapping("/question_submit/getById")
    public QuestionSubmit getSubmitById(@RequestParam("submitId") Long submitId);

    /**
     * 根据id更新题目提交记录
     * @param questionSubmit 更新信息
     * @return 是否更新成功 是 true  否 false
     */
    @PostMapping("/question_submit/updateById")
    public boolean updateById(@RequestBody QuestionSubmit questionSubmit);
}
